﻿using MessagePack;
using System.Collections.Generic;

namespace Manon.Core
{
    /// <summary>
    /// 通用键值数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [MessagePackObject(true)]
    public class CommonDto<T>
    {
        /// <summary>
        /// id
        /// </summary>
        //[ProtoMember(1)]
        public T Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        //[ProtoMember(2)]
        public string Name { get; set; }

    }

    /// <summary>
    /// 通用键值数据包含children
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [MessagePackObject(true)]
    public class CommonWithChildrenDto<T>
    {
        /// <summary>
        /// id
        /// </summary>
        //[ProtoMember(1)]
        public T Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        //[ProtoMember(2)]
        public string Name { get; set; }

        /// <summary>
        /// 是否有删除权限
        /// </summary>
        public bool HasDeleted { get; set; } = true;

        /// <summary>
        /// 子集
        /// </summary>
        //[ProtoMember(3)]
        public IEnumerable<CommonWithChildrenDto<T>> Children { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public int Type { get; set; }

    }

    /// <summary>
    /// 通用键值数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [MessagePackObject(true)]
    public class CommonFullDto<T>
    {
        /// <summary>
        /// id
        /// </summary>
        //[ProtoMember(1)]
        public T Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        //[ProtoMember(2)]
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        //[ProtoMember(3)]
        public string Code { get; set; }

        /// <summary>
        /// 图片路径
        /// </summary>
        //[ProtoMember(4)]
        public string ImageUrl { get; set; }
    }

    /// <summary>
    /// 通用键值数据包含children
    /// </summary>
    /// <typeparam name="T"></typeparam>
    //[ProtoContract]
    [MessagePackObject(true)]
    public class CommonFullWithChildrenDto<T>
    {
        /// <summary>
        /// id
        /// </summary>
        //[ProtoMember(1)]
        public T Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        //[ProtoMember(2)]
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        //[ProtoMember(3)]
        public string Code { get; set; }

        /// <summary>
        /// 图片路径
        /// </summary>
        //[ProtoMember(4)]
        public string ImageUrl { get; set; }

        /// <summary>
        /// 子集
        /// </summary>
        //[ProtoMember(5)]
        public IEnumerable<CommonWithChildrenDto<T>> Children { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public int Type { get; set; }

    }
}
